/*
* Copyright (C) Microsoft. All rights reserved.  
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not 
* use this file except in compliance with the License.  You may obtain a copy 
* of the License at http://www.apache.org/licenses/LICENSE-2.0  
* 
* THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
* WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
* MERCHANTABLITY OR NON-INFRINGEMENT. 
*
* See the Apache License, Version 2.0 for specific language governing 
* permissions and limitations under the License.
*
*/
#pragma once

#include <baja/common.hpp>
#include <baja/graphics.hpp>

namespace baja { namespace app {

namespace b = baja;
namespace g = baja::graphics;

struct icamera : public b::ibase
{
    BAJA_INTERFACE_NOTAG(icamera);

    virtual m::matrix44 matrix() = 0;
    virtual m::point3d position() = 0;
    virtual m::vector3d direction() = 0;
    virtual m::vector3d up() = 0;

    virtual void lerp(
        const std::shared_ptr<icamera>& destination,
        const b::float32 p
        ) = 0;
};

// simple camera always pointing to the origin of coordinates
struct iorigin_camera : public icamera
{
    BAJA_INTERFACE_NOTAG(iorigin_camera);

    virtual void setDistance(const b::float32 distance) = 0;
    virtual b::float32 distance() = 0;

    virtual void set(
        const b::float32 angleX,
        const b::float32 angleY,
        const b::float32 angleZ,
        const b::float32 distance
        ) = 0;

    virtual void rotateDeltaXYZ(
        const b::float32 deltaX,
        const b::float32 deltaY,
        const b::float32 deltaZ
        ) = 0;

    virtual void setOffsetXY(const m::point2d& offset) = 0;
    virtual m::point2d offsetXY() = 0;
};

// simple camera that moves along a plane parallel to a given plane at a given distance
struct iplane_camera : public icamera
{
    virtual void setDistance(const b::float32 distance) = 0;
    virtual b::float32 distance() = 0;

    virtual void move(
        const b::float32 deltaX,
        const b::float32 deltaY
        ) = 0;
};

}} // namespace baja::app

#include <baja/app/origin_camera_impl.hpp>
